package org.displayextended
{
	import flash.display.Sprite;
	
	public class Children
	{
		public static function gather( target:Sprite ):Array
		{
			var children:Array = [];
			var n:int = target.numChildren;
			
			if( n > 0 )
			{
				for( var i:int=0; i < n; i++ )
				{
					children.push( target.getChildAt( i ) );
				}
			}
			
			return children;
		}
		
		public static function print( target:Sprite ):void
		{
			var children:Array = [];
			var n:int = target.numChildren;
			
			trace( "" );
			trace( target );
			trace( "---------- Children.Print() ----------" );
			
			if( n > 0 )
			{
				for( var i:int=0; i < n; i++ )
				{
					trace( i, target.getChildAt( i ) );
				}
			}
			
			trace( "---------------------------------------" );
			trace( "" );
		}
		
		public static function list( target:Sprite ):void
		{
			print( target );
		}
	}
}